package com.rran.study.designpattern.factory.abstractfactory;

/**
 * @author yy
 * @Type AbstractFactoryTest.java
 * @Desc
 * @date 2020/7/22 16:16
 */
public class AbstractFactoryTest {
    public static void main(String[] args) {
        System.out.println("我要一台Intel的电脑");
        ComputerFactory factory = new IntelFactory();

        CPU cpu = factory.makeCPU();
        MainBoard mainBoard = factory.makeMainBoard();
        HardDisk hardDisk = factory.makeHardDisk();

        Computer computer = new Computer(cpu, mainBoard, hardDisk);
        computer.generate();
    }
}
